<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=utf-8"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
<link href="<%= request.getContextPath() + "/css/table.css" %>" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/interface/VisualHelper.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/engine.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/util.js"></script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Consultar</title>
<script language="JavaScript" type="text/javascript">    

    var a, mes, dia, anyo, febrero;
   
    function anyoBisiesto(anyo)
    {
        
        if (anyo < 100)
            var fin = anyo + 1900;
        else
            var fin = anyo ;

        if (fin % 4 != 0)
            return false;
        else
        {
            if (fin % 100 == 0)
            {
                if (fin % 400 == 0)
                {
                    return true;
                } else
                {
                    return false;
                }
            }
            else
            {
                return true;
            }
        }
    }
    
   
    function validar( )
    {
       a=document.actualizarBeneficiario.dia.value+"/"+document.actualizarBeneficiario.mes.value+"/"+document.actualizarBeneficiario.ano.value;
       dia=a.split("/")[0];
       mes=a.split("/")[1];
       anyo=a.split("/")[2];
       if(document.actualizarBeneficiario.numeroDocumento.value==""){
          alert("Debe introducir el numero de documento");
          document.actualizarBeneficiario.numeroDocumento.focus();
          return;
       }
       
       if(document.actualizarBeneficiario.primer_nombre.value==""){
          alert("Debe introducir el primer nombre");
          document.actualizarBeneficiario.primer_nombre.focus();
          return;
       }
       
       if(document.actualizarBeneficiario.primerApellido.value==""){
          alert("Debe introducir el primer apellido");
          document.actualizarBeneficiario.primerApellido.focus();
          return;
       }
       
       if(document.actualizarBeneficiario.vflComuna.value==""){
          alert("Debe seleccionar la comuna");
          document.actualizarBeneficiario.vflComuna.focus();
          return;
       }
      
       if(dia == 'dia' && mes == 'mes' && anyo == 'ano')
       {
          document.actualizarBeneficiario.submit(); 
       }else{
        if( (isNaN(dia)==true) || (isNaN(mes)==true) || (isNaN(anyo)==true) )
        {
            alert("La fecha introducida debe estar formada solo por numeros");
         return;
        }
       if(anyoBisiesto(anyo))
           febrero=29;
       else
           febrero=28;
      
       if ((mes<1) || (mes>12))
       {
           alert("El mes introducido no es valido. Por favor, introduzca un mes correcto");
           document.actualizarBeneficiario.mes.focus();
           //document.actualizarBeneficiario.fecha.select();
           return;
       }
       
       if ((mes==2) && ((dia<1) || (dia>febrero)))
       {
           alert("El dia introducido no es valido. Por favor, introduzca un dia correcto");
           document.actualizarBeneficiario.dia.focus();
           //document.actualizarBeneficiario.fecha.select();
           return;
       }
      
       if (((mes==1) || (mes==3) || (mes==5) || (mes==7) || (mes==8) || (mes==10) || (mes==12)) && ((dia<1) || (dia>31)))
       {
           alert("El dia introducido no es valido. Por favor, introduzca un dia correcto");
           document.actualizarBeneficiario.dia.focus();
           //document.actualizarBeneficiario.fecha.select();
           return;
       }
       
       if (((mes==4) || (mes==6) || (mes==9) || (mes==11)) && ((dia<1) || (dia>30)))
       {
           alert("El dia introducido no es valido. Por favor, introduzca un dia correcto");
           document.actualizarBeneficiario.mes.focus();
           //document.actualizarBeneficiario.fecha.select();
           return;
       }
       
       if ((anyo<1900) || (anyo>2020))
       {
           alert("El año introducido no es valido. Por favor, introduzca un año entre 1900 y 2010");
           document.actualizarBeneficiario.ano.focus();
           //document.actualizarBeneficiario.fecha.select();
           return;
       } 
      field = document.actualizarBeneficiario.dirDescriptiva; 
      if(document.actualizarBeneficiario.dirDescriptiva.value != ""){
        var valid = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyz 1234567890#-/.,& "
        var ok = "yes";
        var temp;
        for (var i=0; i<field.value.length; i++) {
        temp = "" + field.value.substring(i, i+1);
        if (valid.indexOf(temp) == "-1") ok = "no";
        }
      }
      if (ok == "no") {
        alert("La direccion descriptiva solo permite letras (A - Z | a - z)");
        field.focus();
        field.select();
        return;
      }
      
       else
          document.actualizarBeneficiario.submit();
      }
    }  

  function buscarBarrios(origen)
  {
      VisualHelper.buscarPadre(dwr.util.getValue("barrios"),function(data) {
        var array = data.split("|"); 
        dwr.util.setValue("comunas",array[0]);
        dwr.util.setValue("zonas",array[1]);
      });
  }
  
 
  function LimpiarEnc()
  {
    document.actualizarBeneficiario.dirDescriptiva.disabled = false;
    document.actualizarBeneficiario.dirEncasillada.value = '';
    document.actualizarBeneficiario.viaTipo.value = '';
    document.actualizarBeneficiario.vNro.value = '';
    document.actualizarBeneficiario.viaOrientacion.value = '';
    document.actualizarBeneficiario.viaApendice.value = '';
    document.actualizarBeneficiario.cruceOrientacion.value = '';
    document.actualizarBeneficiario.cruceNumero.value = '';
    document.actualizarBeneficiario.cruceApendice.value = '';
    document.actualizarBeneficiario.placa.value = '';
    document.actualizarBeneficiario.interior.value = '';
    document.actualizarBeneficiario.bloque.value = '';
  }

  function agregar(object,origen)
  {
    document.actualizarBeneficiario.dirDescriptiva.value="";
    document.actualizarBeneficiario.dirDescriptiva.disabled = true;
    if(document.actualizarBeneficiario.viaTipo.value==0){
      alert('El tipo no es valido.')
      return;
    }
    if(origen == 'tipo')
    {
      tipo = object.value.toUpperCase();
    }
    if(origen == 'vNro'){
      vNro = object.value.toUpperCase();
    }
    if(origen == 'vOr'){
      vOr = object.value.toUpperCase();
    }
    if(origen == 'vApn'){
      vApn = object.value.toUpperCase();
    }
    if(origen == 'cOr'){
      cOr = object.value.toUpperCase();
    }
    if(origen == 'cNro'){
      cNro = object.value.toUpperCase();
    }
    if(origen == 'cApn') {
      cApn = object.value.toUpperCase();
    }
    if(origen == 'placa'){
      placa = object.value.toUpperCase();
    }
    if(origen == 'interior'){
      interior = object.value.toUpperCase();
    }
    if(origen == 'bloque'){
      bloque = object.value;
    }
    
    direccion = "";
    if(tipo != null && tipo != '0')
      direccion += tipo+" ";
    if(vOr != null && vOr != "" && vOr != '0')
      direccion += vOr;
    if(vNro != null && vNro != "" && vNro != '0')
      direccion += vNro+" ";
    if(vApn != null && vApn != "" && vApn != '0')
      direccion += vApn+"   ";
    if(cOr != null && cOr != "" && cOr != '0')
      direccion += cOr+" ";
    if(cNro != null && cNro != "" && cNro != '0')
      direccion += cNro;
    if(cApn != null && cApn != "" && cApn != '0')
      direccion += cApn;
    if(placa != null && placa != "" && placa != '0')
      direccion += "-"+placa+" ";
    if(bloque != null && bloque != "" && bloque != '0')
      direccion += bloque;
    if(interior != null && interior != "" && interior != '0')
      direccion += "("+interior+")";
    
    //document.actualizarBeneficiario.dirEncasillada.value =  tipo+" "+vOr+vNro+" "+vApn+"   "+cOr+cNro+" "+cApn+" "+placa+" "+bloque+interior;
    document.actualizarBeneficiario.dirEncasillada.value =  direccion;
  }
  
</script>
</head>
<body>

    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
       
      <tr align="left"> 
       <td height="25" colspan="12" align="center" class="titulosenblanco"> 
        <p>
         <STRONG>Actualizaci&oacute;n de la Informaci&oacute;n del Beneficiario</STRONG>
        </p>
        <p>&nbsp; </p>
       </td>
       </tr>
  
       <logic:present name="msg" scope="request">
          <%=request.getAttribute("msg") == null ? "" : request.getAttribute("msg")%>
       </logic:present>
       <html:form  action="/beneficiarios/ActualizarBeneficiario.do"  method="post"  type="com.cs.beneficios.web.form.BuscarBeneficiarioForm">
            <bean:define id="beneficiario" scope="request" name="beneficiario" type="com.cs.beneficios.business.model.BeneficiarioVO"/>
            <input type="hidden" name="code" value="<%=beneficiario.getCode()%>" />
            <tr align="left">
                <td height="25" colspan="12" class="titulosenblanco">   
                    <table width="100%" border="0" cellspacing="3" cellpadding="3" class="titulosenrojo">
                        <tr>
                            <td width="28%">&nbsp;</td>
                            <td colspan="3">       
                                <DIV align="left">
                                  <html:errors/>
                                </DIV>
                            </td>
                        </tr>
                        <tr>
                            <td width="28%">&nbsp;</td>
                            <td width="23%" class="celdatabla"><strong>Tipo Documento</strong>(*)</td>
                            <td width="46%"> 
                                  <html:select property="tipoDocumento" styleClass="form"  value="<%=beneficiario.getTipoDocumento()%>">
                                    <html:option value="C">C&eacute;dula de ciudadania</html:option>
                                    <html:option value="E">C&eacute;dula de extranjeria</html:option>
                                    <html:option value="N">Nit</html:option>
                                    <html:option value="P">Pasaporte</html:option>
                                    <html:option value="R">Registro civil</html:option>
                                    <html:option value="T">Tarjeta de identidad</html:option>
                                    <html:option value="I">NIP</html:option>
                                    <html:option value="U">NUIP</html:option>
                                    <html:option value="S">NISE</html:option>
                                    <html:option value="A">Cabildo</html:option>
                                    <html:option value="O">Otro</html:option>
                                  </html:select>
                            </td>
                            <td width="3%">&nbsp;</td>
                        </tr>
                        <tr>
                            <td width="28%">&nbsp;</td>
                            <td width="23%" class="celdatabla">
                              <strong>Numero Documento </strong>(*) 
                            </td>
                            <td width="46%"> 
                                    <html:text property="numeroDocumento" size="15" styleClass="form" value="<%=beneficiario.getNumeroDocumento()%>"/></td>
                            <td width="3%">&nbsp;</td>
                        </tr>
                       <tr>
                            <td width="28%">&nbsp;</td>
                            <td width="23%" class="celdatabla"><strong>Primer Nombre</strong> (*)&nbsp;&nbsp; 
                            </td>
                            <td width="46%"> 
                                    <html:text property="primer_nombre" size="30" styleClass="form" value="<%=beneficiario.getNombre1()%>"/></td>
                            <td width="3%">&nbsp;</td>
                       </tr>
                       <tr>
                            <td width="28%">&nbsp;</td>
                            <td width="23%" class="celdatabla"><strong>Segundo Nombre</strong> 
                            </td>
                            <td width="46%"> 
                                    <html:text property="segundo_nombre" size="30" styleClass="form" value="<%=beneficiario.getNombre2()%>"/></td>
                            <td width="3%">&nbsp;</td>
                       </tr>
                       <tr>
                            <td width="28%">&nbsp;</td>
                            <td width="23%" class="celdatabla"><strong>Primer Apellido</strong> (*)&nbsp;&nbsp; 
                            </td>
                            <td width="46%"> 
                                    <html:text property="primerApellido" size="15" styleClass="form" value="<%=beneficiario.getPrimerApellido()%>"/> &nbsp; 
                            </td>
                            <td width="3%">&nbsp;</td>
                       </tr>
                       <tr>
                            <td width="28%">&nbsp;</td>
                            <td width="23%" class="celdatabla"><strong>Segundo Apellido</strong> 
                            </td>
                            <td width="46%">
                                    <html:text property="segundoApellido" size="15" styleClass="form" value="<%=beneficiario.getSegundoApellido()%>"/> &nbsp;&nbsp; 
                            </td>
                            <td width="3%">&nbsp;</td>
                       </tr>
                       <tr>
                            <td width="28%">&nbsp;</td>
                            <td width="23%" class="celdatabla"><strong>Fecha Nacimiento</strong> (dd/mm/aaaa)&nbsp;&nbsp;
                            </td>
                            <td width="46%">
                              <P>
                                <html:select property="dia" styleClass="form" value="<%=beneficiario.getFenatoDay()%>">
                                  <html:option value="dia">D&iacute;a</html:option>
                                    <% 
                                        for(int i = 1; i<=31;i++)
                                        {
                                          String dia = i+"";
                                          if(i<10) dia = "0"+i;
                                    %>
                                  <html:option value="<%=dia%>">
                                          <%= dia%>
                                  </html:option>
                                    <%          
                                        }                  
                                    %>
                                </html:select>
                                <FONT color="#000000">/</FONT> 
                                <html:select property="mes" styleClass="form" value="<%=beneficiario.getFenatoMonth()%>">
                                    <html:option value="mes">Mes</html:option>
                                    <% 
                                        for(int i = 1; i<=12;i++)
                                        {
                                          String mes = i+"";
                                          if(i<10) mes = "0"+i;
                                    %>
                                  <html:option value="<%=mes%>">
                                    <%= mes%>
                                  </html:option>
                                  <%          
                                        }                  
                                  %>
                                </html:select>
                                <FONT color="#000000">/ </FONT>
                                <html:select property="ano" styleClass="form" value="<%=beneficiario.getFenatoYear()%>">
                                    <html:option value="ano">A&ntilde;o</html:option>
                                    <% 
                                        for(int i = 1900; i<=2030;i++)
                                        {
                                          String ano = i+"";
                                    %>
                                          <html:option value="<%=ano%>">
                                            <%= ano%>
                                          </html:option>
                                    <%          
                                        }                  
                                    %>
                                </html:select>
                                </P>
                                <P align="center">
                                    <input type="hidden" name="fecha"/>
                                </P> 
                                </td>
                            <td width="3%">&nbsp;</td>
                    </tr>
                   <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>Sexo</strong>
                        </td>
                        <td width="46%"> 
                              <html:select property="sexo"  styleClass="form"  value="<%=beneficiario.getSexo()%>">
                                <html:option value="M">Masculino</html:option>
                                <html:option value="F">Femenino</html:option>
                              </html:select>
                        </td>
                        <td width="3%">&nbsp;</td>
                   </tr>
                   <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>Tel&eacute;fono</strong>
                        </td>
                        <td width="46%"> 
                                <html:text property="telefono" size="15" styleClass="form" value="<%=beneficiario.getTelefono()%>"/></td>
                        <td width="3%">&nbsp;</td>
                   </tr>
           
           
           
                    <tr>
                        <td width="28%">&nbsp;</td>
                        <td colspan="3" class="celdatabla">
                          <DIV align="left">
                            <P>
                              <strong>Direcci&oacute;n Encasillada</strong> 
                            </P>
                            </DIV>
                        </td>
                    </tr>
                   <tr>
                     <td width="28%">&nbsp;</td>
                     <td colspan="3" class="celdatabla">
                       <table cellspacing="3" align="left"  cellpadding="2" border="1" width="48%">
                         <tr>
                           <td colspan="4">
                             <DIV align="center">
                               <STRONG class="celdatabla">Datos de la via</STRONG> 
                             </DIV>
                           </td>
                           <td colspan="3">
                             <DIV align="center">
                               <STRONG class="celdatabla">Datos del cruce</STRONG>
                             </DIV>
                           </td>
                           <td colspan="3">
                             <DIV align="center">
                               <STRONG class="celdatabla">Datos adicionales</STRONG>
                             </DIV>
                           </td>
                         </tr>
                         <tr>
                           <td>
                             <DIV align="center">Tipo</DIV>
                           </td>
                           <td>
                             <DIV align="center">Or.</DIV>
                           </td>
                           <td>
                             <DIV align="center">Nro.</DIV>
                           </td>
                           <td>
                             <DIV align="center">Apn.</DIV>
                           </td>
                           <td>
                             <DIV align="center">Or.</DIV>
                           </td>
                           <td>
                             <DIV align="center">Nro.</DIV>
                           </td>
                           <td>
                             <DIV align="center">Apn.</DIV>
                           </td>
                           <td>
                             <DIV align="center">Placa</DIV>
                           </td>
                           <td>
                             <DIV align="center">Bloque</DIV>
                           </td>
                           <td>
                             <DIV align="center">Interior</DIV>
                           </td>
                        </tr>
                         <tr>
                           <td>
                             <select size="1" name="viaTipo" onchange="agregar(this,'tipo')"  onmouseover="this.T_WIDTH=180;this.T_TITLE='Tipo de via';return escape('Corresponde al tipo de via.')" class="form">
                             <% if(beneficiario.getTipo() != null){
                                    if(beneficiario.getTipo().equals("0")){%>
                                     <option value="0" selected="selected"></option>
                                  <%}else{%>
                                     <option value="0"></option>
                                  <%}%>
                                  <% if(beneficiario.getTipo().equals("CR")){%>
                                     <option value="CR" selected="selected">Carrera</option>
                                  <%}else{%>
                                     <option value="CR">Carrera</option>
                                  <%}%>
                                  <% if(beneficiario.getTipo().equals("CL")){%>
                                     <option value="CL" selected="selected">Calle</option>
                                  <%}else{%>
                                     <option value="CL">Calle</option>
                                   <%}%>
                                  <% if(beneficiario.getTipo().equals("CQ")){%>  
                                     <option value="CQ" selected="selected">Circular</option>
                                  <%}else{%>
                                     <option value="CQ">Circular</option>
                                   <%}%>
                                  <% if(beneficiario.getTipo().equals("TR")){%>
                                     <option value="TR" selected="selected">Transversal</option>
                                  <%}else{%>
                                     <option value="TR" >Transversal</option>
                                   <%}%>
                                  <% if(beneficiario.getTipo().equals("DG")){%>
                                     <option value="DG" selected="selected">Diagonal</option>
                                  <%}else{%>
                                     <option value="DG">Diagonal</option>
                                   <%}%>
                                  <% if(beneficiario.getTipo().equals("AV")){%>
                                     <option value="AV" selected="selected">Avenida</option>
                                  <%}else{%>
                                     <option value="AV">Avenida</option>
                                  <%}
                                  }else{%>
                                    <option value="0"></option>
                                    <option value="CR">Carrera</option>
                                    <option value="CL">Calle</option>
                                    <option value="CQ">Circular</option>
                                    <option value="TR" >Transversal</option>
                                    <option value="DG">Diagonal</option>
                                    <option value="AV">Avenida</option>
                                  <%}%>
                             </select>
                           </td>
                           <td>
                             <select size="1" class="form" onchange="agregar(this,'vOr')" name="viaOrientacion" onmouseover="this.T_WIDTH=180;this.T_TITLE='Orientacion de la via';return escape('Corresponde a la orientacion de la via.')">
                             <% if(beneficiario.getVOr() != null){
                                    if(beneficiario.getVOr().equals("0")){%>
                               <option value="0" selected="selected"></option>
                            <%}else{%>
                               <option value="0"></option>
                            <%}%>
                            <% if(beneficiario.getVOr().equals("E")){%>
                               <option value="E" selected="selected">Este</option>
                            <%}else{%>
                               <option value="E">Este</option>
                            <%}%>
                            <% if(beneficiario.getVOr().equals("E")){%>
                               <option value="S" selected="selected">Sur</option>
                            <%}else{%>
                               <option value="S">Sur</option>
                             <%}
                            }else{%>  
                               <option value="0"></option>
                               <option value="E">Este</option>
                               <option value="S">Sur</option>
                            <%}%>
                             </select>
                           </td>
                           <td>
                             <input type="text" value="<%=beneficiario.getVNro()%>" onchange="agregar(this,'vNro')" name="vNro" class="form" maxlength="3" size="3" onmouseover="this.T_WIDTH=180;this.T_TITLE='Numero de la via';return escape('Corresponde al numero de la via.')"/>
                           </td>       
                           <td>
                                 <input type="text" value="<%=beneficiario.getVAp()%>" class="form" size="2" maxlength="2"  name="viaApendice" onchange="agregar(this,'vApn')" onmouseover="this.T_WIDTH=180;this.T_TITLE='Apendice de la via';return escape('Corresponde al apendice; ejemplo: A, AA, B, BB etc.')"/>
                           </td>
                           <td>
                             <DIV align="center">
                               <select size="1" class="form" name="cruceOrientacion" onchange="agregar(this,'cOr')" onmouseover="this.T_WIDTH=180;this.T_TITLE='Orientacion del cruce';return escape('Corresponde a la orientacion del cruce.')">
                                 <% if(beneficiario.getCOr() != null){
                                    if(beneficiario.getCOr().equals("0")){%>
                               <option value="0" selected="selected"></option>
                            <%}else{%>
                               <option value="0"></option>
                            <%}%>
                            <% if(beneficiario.getCOr().equals("E")){%>
                               <option value="E" selected="selected">Este</option>
                            <%}else{%>
                               <option value="E">Este</option>
                            <%}%>
                            <% if(beneficiario.getCOr().equals("S")){%>
                               <option value="S" selected="selected">Sur</option>
                            <%}else{%>
                               <option value="S">Sur</option>
                             <%}
                            }else{%>  
                               <option value="0"></option>
                               <option value="E">Este</option>
                               <option value="S">Sur</option>
                            <%}%>
                               </select>
                             </DIV>
                           </td>
                           <td>
                             <DIV align="center">
                               <input type="text" value="<%=beneficiario.getCNro()%>" class="form" size="3" maxlength="3" name="cruceNumero" onchange="agregar(this,'cNro')" onmouseover="this.T_WIDTH=180;this.T_TITLE='Numero del cruce';return escape('Primer numero de la placa de la puerta.')"/>
                             </DIV>
                           </td>
                           <td>
                             <DIV align="center">
                               <input type="text" value="<%=beneficiario.getCAp()%>" class="form" maxlength="2" size="2" name="cruceApendice" onchange="agregar(this,'cApn')" onmouseover="this.T_WIDTH=180;this.T_TITLE='Apendice del cruce';return escape('Corresponde al apendice; ejemplo: A, AA, B, BB etc.')"/>
                             </DIV>
                           </td>
                           <td>
                             <DIV align="center">
                               <input type="text" value="<%=beneficiario.getPlaca()%>" size="3" maxlength="3" name="placa" onchange="agregar(this,'placa')" class="form" onmouseover="this.T_WIDTH=180;this.T_TITLE='Placa';return escape('Es el segundo numero de la puerta y que corresponde a la distancia que existe entre la esquina y la propiedad.')"/>
                             </DIV>
                           </td>
                           <td>
                             <DIV align="center">
                               <input type="text" value="<%=beneficiario.getBloque()%>" class="form" maxlength="2" name="bloque" onchange="agregar(this,'bloque')" size="2" onmouseover="this.T_WIDTH=180;this.T_TITLE='Bloque';return escape('Aplica para edificios o unidades residenciales.')"/>
                             </DIV>
                           </td>
                           <td>
                             <DIV align="center">
                               <input type="text" value="<%=beneficiario.getInterior()%>" class="form" size="5" name="interior" onchange="agregar(this,'interior')" maxlength="5" onmouseover="this.T_WIDTH=180;this.T_TITLE='Interior';return escape('El numero de apartamento, si es el caso.')"/>
                             </DIV>
                           </td>
        
                         </tr>
                         <tr>
                            <td colspan="10">
                              <DIV align="center">
                                <STRONG>Direccion Generada
                                </STRONG>
                              </DIV>
                            </td>
                         </tr>
                         <tr>
                            <td colspan="10">
                              <DIV align="center"><html:text property="dirEncasillada" size="40" value="<%=beneficiario.getDirEncasillada()%>" styleClass="form" readonly="true"/>
                                  <input type="button" value="Limpiar" onclick="LimpiarEnc()"/>
                              </DIV>
                            </td>
                         </tr>
                       </table>
                     </td>
                   </tr>   
                   
                   
                   <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>Direcci&oacute;n Descriptiva</strong>
                        </td>
                        <td width="46%"> 
                                <html:text property="dirDescriptiva" size="40" styleClass="form" value="<%=beneficiario.getDirDescriptiva()%>"/>
                        </td>
                        <td width="3%">&nbsp;</td>
                   </tr>
                   <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>Barrio/Vereda</strong>
                        </td>
                        <td width="46%"> 
                                <html:select styleId="barrios" property="codeBarrio" styleClass="form" value="<%=beneficiario.getCodeBarrio()%>" onchange="buscarBarrios('barrio')">
                                    <html:option value="">Seleccione un barrio</html:option>
                                    <logic:present name="barrios">
                                      <html:options name="barrios" labelName="code" labelProperty="descVflex" property="code" collection="barrios" />
                                    </logic:present>
                                </html:select>
                        </td>
                        <td width="3%">&nbsp;</td>
                   </tr>
                   <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>Comuna/Corregimiento</strong>(*)
                        <input type="hidden" name="opcion" value=""/>
                        </td>
                        <td width="46%"> 
                            <html:select styleId="comunas" property="vflComuna" styleClass="form" value="<%=beneficiario.getVflComuna()%>">
                                <html:option value="">Seleccione una comuna</html:option>
                                <html:options name="comunas" labelName="code" labelProperty="descVflex" property="code" collection="comunas" />
                            </html:select>
                        </td>
                        <td width="3%">&nbsp;</td>
                   </tr>
                   <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>Zona</strong>
                        </td>
                        <td width="46%"> 
                                <html:select styleId="zonas" property="codeZona" styleClass="form" value="<%=beneficiario.getCodeZona()%>">
                                    <html:option value="">Seleccione una zona</html:option>
                                    <html:options name="zonas" labelName="code" labelProperty="descVflex" property="code" collection="zonas" />
                                </html:select>
                        </td>
                        <td width="3%">&nbsp;</td>
                   </tr>
                    <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>Cobama</strong>
                        </td>
                        <td width="46%"> 
                                <html:text property="cobama" size="8" maxlength="7" styleClass="form" value="<%=beneficiario.getCobama()%>"/></td>
                        </td>
                        <td width="3%">&nbsp;</td>
                   </tr>
                   <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>Etnia</strong>
                        </td>
                        <td width="46%"> 
                                <html:select property="etnia" styleClass="form" value="<%=beneficiario.getEtnia()%>">
                                    <html:option value="O">Otra</html:option>
                                    <html:option value="A">Afrocolombiano</html:option>
                                    <html:option value="I">Indigena</html:option>
                                </html:select>
                        </td>
                        <td width="3%">&nbsp;</td>
                   </tr>
                   <tr>
                        <td width="28%">&nbsp;</td>
                        <td width="23%" class="celdatabla"><strong>E-mail</strong>
                        </td>
                        <td width="46%"> 
                                <html:text property="mail" size="20" styleClass="form" value="<%=beneficiario.getMail()%>" />
                        </td>
                        <td width="3%">&nbsp;</td>
                   </tr>
                   <tr>
                   <tr>
                        <td colspan="4">&nbsp;</td>
                   </tr>
           
                   <tr>
                     <td  colspan="4">
                       <DIV align="center">
                         <input type="button" value="Guardar" onClick="validar();"/>
                       </DIV>
                     </td>
                   </tr>
           </table>
          </td>
        </tr>  
       </html:form>  
      </table>

<script language="javascript" type="text/javascript">
  var tipo = document.actualizarBeneficiario.viaTipo.value;
  var vNro = document.actualizarBeneficiario.vNro.value;
  var vOr = document.actualizarBeneficiario.viaOrientacion.value;
  var vApn = document.actualizarBeneficiario.viaApendice.value;
  var cOr = document.actualizarBeneficiario.cruceOrientacion.value;
  var cNro = document.actualizarBeneficiario.cruceNumero.value;
  var cApn = document.actualizarBeneficiario.cruceApendice.value;
  var placa = document.actualizarBeneficiario.placa.value;
  var interior = document.actualizarBeneficiario.interior.value;
  var bloque = document.actualizarBeneficiario.bloque.value;
</script>

<table  cellspacing="3" cellpadding="2" border="0" width="70%" align="center">
 
    <tr>
      <td align="center">
        <%
              java.util.Enumeration enumera = request.getParameterNames();
              java.util.HashMap params = new java.util.HashMap();
              while(enumera.hasMoreElements())
              {
                String key = enumera.nextElement().toString();
                String value = request.getParameter(key);
                params.put(key, value);
              }
       
              params.put("regresar", "1");
              pageContext.setAttribute("parametros", params);
         %>
          <html:link name="parametros" scope="page" page="/beneficiarios/Buscar.do">
            <img src="<%= request.getContextPath() + "/images/b_atras.gif" %>" width="24" height="15" border="0"/>
            <br/>
            <span class="celdaayd">Atras</span>
          </html:link>
      </td>
    </tr>
</table>

</body>
</html>